package com.zny.sescore.controller;

import com.zny.sescore.model.LoginInfo;
import com.zny.sescore.util.RequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.util.WebUtils;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Controller基类
 *
 * @author zhangnayi
 * @date 2021/03/26 19:48
 */
@Slf4j
public class BaseController {

    /**
     * 获取当前登录用户
     *
     * @author zhangnayi
     * @date 2021-03-28 15:35
     */
    protected LoginInfo getLoginUser() {
        return RequestUtil.getLoginUser();
    }

    protected Map<String, Object> jsonToDataMap(HttpServletRequest request) {
        return WebUtils.getParametersStartingWith(request, "");
    }
}